#include <iostream>
using namespace std;

class Base1 {
  public:
    virtual void func1() {
      cout << "Base1::func1()" << endl;
    }
};
class Base2 {
  public:
    virtual void func2() {
      cout << "Base1::func2()" << endl;
    }
};

class Derived : public Base1, public Base2 {
};

class AbsBase1 {
  public:
    virtual void func1() = 0;
};
class AbsBase2 {
  public:
    virtual void func2() = 0;
};
class Derived2 : public AbsBase1, public AbsBase2 {
  public:
    virtual void func1() {}
    virtual void func2() {}
};

void test() {
  Derived d;
  // 大小为 16，两个 vptr
  cout << "Derived 类的大小: " << sizeof(d) << endl;

  Derived2 d2;
  // 大小也为 16，两个 vptr
  cout << "Derived2 类的大小：" << sizeof(d2) << endl;
}

int main() {
  test();
  return 0;
}

